/*
 * @Author: sxb
 * @Email: sxb@mail.com
 * @Date: 2020-06-30 16:02:29
 * @Descripttion: 公告内容操作类
 */ 
import request from '@/utils/request'

export function apiGetSystemAnnouncement(data) {
    if(data !== undefined && data !== null){
        data.page = data.page < 0 ? 0 : data.page - 1
    }
    return new Promise((resolve, reject) => {
        request.get('api/systemAnnouncement',{params:data}).then(res => {
            resolve(res);
        }).catch(error => {
            reject(error)
        })
    })
}

export function apiPostSystemAnnouncement(data){
    return new Promise((resolve, reject) => {
        request.post('api/systemAnnouncement', data).then(res => {
            resolve(res);
        }).catch(error => {
            reject(error)
        })
    })
}

export function apiPutSystemAnnouncement(data){
    return new Promise((resolve, reject) => {
        request.put('api/systemAnnouncement', data).then(res => {
            resolve(res);
        }).catch(error => {
            reject(error)
        })
    })
}

export function apiDelSystemAnnouncement(data){
    return new Promise((resolve, reject) => {
        request.delete('api/systemAnnouncement', {data:data}).then(res => {
            resolve(res);
        }).catch(error => {
            reject(error)
        })
    })
}